				RANK SUM TEST


Michael Lloyd (http://www.hsu.edu/faculty/lloydm/ti/prgmtabl.html)
Henderson State University

Also called the Mann-Whitney U Test

HISTORY
1.0 - December 1997
1.1 - August 2015, Updated file to .8xp

INSTRUCTIONS

Put the group A data and group B data in a couple of lists. For example,
if the data is

11 6 21 23 16 1 3 10 13 8
12 7 5 24 4 14 19 22 18 2

then the program will display

Group A used
Sum of ranks R = 99
Mean of R = 105
Standard deviation of R = 13.23
Z score of R = -.454
Test statistic U = 44
Mean of U = 50
Standard deviation of U = 13.23
Z score of U = -.454

(U = R - n1(n2+1)/2 is another statistic that some people use instead
of R to do this test.)

VARIABLES USED
A = lower limit of summation, average of ranks, minimum of group sizes
B = upper limit of summation
I,K = counters
L = sample size of group A
list thetaA = group A data
list thetaB = group B data
list RANK = ranks
list TEMP= combined data
list thetaS= 1's indicate smaller group elements
M = mean of test statistics
N = total sample size
O = sample size of group B
prgmZZRANK
R = rank sum statistic
S = total sample size, standard deviation test statistic
T = test
U = U test statistic

PROGRAM LISTING
Disp "RANK SUM TEST"
Input "GROUP A=",\L\\theta\A
Input "GROUP B=",\L\\theta\B
dim(\L\\theta\A)\->\L:dim(\L\\theta\B)\->\O
L+O\->\N
L+1\->\A:N\->\B
augment(\L\\theta\A,\L\\theta\B)\->\\L\TEMP
If L\<=\O
Then
Disp "GROUP A USED"
1\->\A:L\->\B
Else
Disp "GROUP B USED"
End
N\->\dim(\L\\theta\S)
Fill(0,\L\\theta\S)
For(I,A,B)
1\->\\L\\theta\S(I)
End
SortA(\L\TEMP,\L\\theta\S)
seq(K,K,1,N)\->\\L\RANK
prgmZZRANK
sum(\L\\theta\S\L\RANK)\->\R
\root\(LO(N+1)/12)\->\S
min(L,O)\->\A
Disp "SUM OF RANKS R=",R
A(N+1)/2\->\M:Disp "MEAN R=",M
Disp "STD DEV R=",S
Pause 
Disp "Z SCORE R",(R-M)/S
R-A(A+1)/2\->\U
Disp "TEST STAT U=",U
LO/2\->\M:Disp "MEAN U=",M
Pause 
Disp "STD DEV U=",S
Disp "Z SCORE U=",(U-M)/S
DelVar \L\TEMP:DelVar \L\\theta\A:DelVar \L\\theta\B:DelVar \L\\theta\S:DelVar \L\RANK